package customerEnter.Frame.DaoDataTransmission;

import java.lang.reflect.Field;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;

import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.jdbc.support.rowset.SqlRowSet;

import customerEnter.Frame.Enum.FrameDataSqlDMLUse;
import customerEnter.Frame.JDBCDao.Interface.ParametersResultInterface;
import customerEnter.Frame.JDBCDao.Interface.SqlPrecompileParameterInterface;
import customerEnter.Frame.ehcache.AvailableEhcache.EcacheDataTransmission;

/**
 * 数据查詢的屬性
 * 
 * 类名称：DaoFramePameTransmission 类描述： 创建人：dy 创建时间：2016-3-28 上午8:59:06
 * 
 */
public class DaoFramePameTransmission<T, K> {

	public String							ClassName				= "";

	public String							SqltatementType			= "PreparedStatement";

	public EcacheDataTransmission			ecacheDataTransmission	= null;

	RedisTemplate<String, String>			redisTemplate;

	public String							SQL						= "";
	public List<Object>						list;											// 數據集合
	// public SqlRowSet sqlRowSet;

	public ResultSet						rs;
	public SqlRowSet						sqlRowSet;
	public int[]							ins						= { 0 };				// 批量操作結果集合

	public int								in;											// 增刪改結果

	public int								CacheTime				= 1;

	public int								Counter					= 0;					// 计数器

	public TimeUnit							timeUnit				= TimeUnit.MINUTES;

	public FrameDataSqlDMLUse				frameDataSqlDMLUse;
	/**
	 * 數據查詢返回的值
	 */
	@SuppressWarnings("rawtypes")
	public List								DaoFramelistOther		= new ArrayList();

	/**
	 * 定義透明變量
	 */
	public Class<?>							c;
	/**
	 * 定義準確類型
	 */
	public Class<T>							daoFrameT;
	/**
	 * 定義準確類型
	 */
	public Class<K>							daoFrameK;
	/**
	 * 定義準確類型
	 */
	public Class<?>							daoFrame;
	/**
	 * 臨時循環賦值變量
	 */
	@SuppressWarnings("rawtypes")
	public Class							cls;

	public Map<String, String>				columnNameMap;

	public Map<String, Object>				beanAttributes;

	public List<Field>						listFields;

	/**
	 * 是否是分頁數據
	 */
	public Boolean							pagingParametersCount;

	public ParametersResultInterface<T>		pagingParametersResult;

	public Object							mappingObject;

	private boolean							IfUpdate;

	private boolean							isReturnId;

	public SqlPrecompileParameterInterface	sqlPrecompileParameterInterface;

	private boolean							IsPreparedStatementParameter;

	private FramAboutMay					framAboutMay;

	public SqlPrecompileParameterInterface getSqlPrecompileParameterInterface() {
		return sqlPrecompileParameterInterface;
	}

	public void setSqlPrecompileParameterInterface(SqlPrecompileParameterInterface sqlPrecompileParameterInterface) {
		this.sqlPrecompileParameterInterface = sqlPrecompileParameterInterface;
	}

	public boolean isIsPreparedStatementParameter() {
		return IsPreparedStatementParameter;
	}

	public void setIsPreparedStatementParameter(boolean isPreparedStatementParameter) {
		IsPreparedStatementParameter = isPreparedStatementParameter;
	}

	public Object getMappingObject() {
		return mappingObject;
	}

	public void setMappingObject(Object mappingObject) {
		this.mappingObject = mappingObject;
	}

	public boolean isReturnId() {
		return isReturnId;
	}

	public void setReturnId(boolean isReturnId) {
		this.isReturnId = isReturnId;
	}

	public boolean isIfUpdate() {
		return IfUpdate;
	}

	public void setIfUpdate(boolean ifUpdate) {
		IfUpdate = ifUpdate;
	}

	/**
	 * 臨時循環賦值變量
	 */
	public String getSqltatementType() {
		return SqltatementType;
	}

	public void setSqltatementType(String sqltatementType) {
		SqltatementType = sqltatementType;
	}

	public Map<String, String> getColumnNameMap() {
		return columnNameMap;
	}

	public void setColumnNameMap(Map<String, String> columnNameMap) {
		this.columnNameMap = columnNameMap;
	}

	public Map<String, Object> getBeanAttributes() {
		return beanAttributes;
	}

	public void setBeanAttributes(Map<String, Object> beanAttributes) {
		this.beanAttributes = beanAttributes;
	}

	@SuppressWarnings("rawtypes")
	public ParametersResultInterface getPagingParametersResult() {
		return pagingParametersResult;
	}

	@SuppressWarnings({ "rawtypes", "unchecked" })
	public void setPagingParametersResult(ParametersResultInterface pagingParametersResult) {
		this.pagingParametersResult = pagingParametersResult;
	}

	public RedisTemplate<String, String> getRedisTemplate() {
		return redisTemplate;
	}

	public void setRedisTemplate(RedisTemplate<String, String> redisTemplate) {
		this.redisTemplate = redisTemplate;
	}

	public DaoFramePameTransmission() {

	}

	@SuppressWarnings("rawtypes")
	public DaoFramePameTransmission(FrameDataSqlDMLUse frameDataSqlDMLUse) {
		this.frameDataSqlDMLUse = frameDataSqlDMLUse;
		setPagingParametersResult(new PagingParametersResult());

	}

	public FrameDataSqlDMLUse getFrameDataSqlDMLUse() {
		return frameDataSqlDMLUse;
	}

	public void setFrameDataSqlDMLUse(FrameDataSqlDMLUse frameDataSqlDMLUse) {
		this.frameDataSqlDMLUse = frameDataSqlDMLUse;
	}

	public ResultSet getRs() {
		return rs;
	}

	public void setRs(ResultSet rs) {
		this.rs = rs;
	}

	public List<Object> getList() {
		return list;
	}

	public void setList(List<Object> list) {
		this.list = list;
	}

	public FramAboutMay getFramAboutMay() {
		return framAboutMay;
	}

	public void setFramAboutMay(FramAboutMay framAboutMay) {
		this.framAboutMay = framAboutMay;
	}

}
